

#include "VFVCellKernel.h"
#include "libmesh/error_vector.h"


registerMooseObject("O4App", VFVCellKernel);

template <>
InputParameters
validParams<VFVCellKernel>()
{
  InputParameters params = validParams<Kernel>();
  // params.addParam<Real>("average", 1, "虚假的平均值");
  params.addRequiredParam<IndicatorName>("average", "单元平均值");

  params.addParam<Real>("lamda", 1E+06, "内罚值");
  
  return params;
}

VFVCellKernel::VFVCellKernel(const InputParameters & parameters)
  : Kernel(parameters),
  _average(getErrorVector(getParam<IndicatorName>("average"))),
  _lamda(1E+06)
{

}

Real
VFVCellKernel::computeQpResidual()
{
    auto id = _current_elem->id();
    mooseInfo(_average.size());
    // auto a = _average[id];
    RealGradient u = RealGradient(_u[_qp],0,0);
	return 0; // _lamda* (_u[_qp] - id)* _test[_i][_qp];
}

Real
VFVCellKernel::computeQpJacobian()
{
	return 0;// _lamda* _test[_i][_qp] * _phi[_j][_qp];
}

ErrorVector & VFVCellKernel::getErrorVector(std::string indicator)
{
  return _fe_problem.adaptivity().getErrorVector(indicator);
}